package cn.enilu.flash.bean.entity.bus;

import cn.enilu.flash.bean.entity.BaseEntity;
import lombok.Data;
import org.hibernate.annotations.Table;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.*;

@Entity(name="t_bus_menu_foods")
@Table(appliesTo = "t_bus_menu_foods",comment = "菜单食品")
@Data
@EntityListeners(AuditingEntityListener.class)
public class MenuFoods extends BaseEntity {

    @Column(name="menu_id",columnDefinition = "BIGINT COMMENT '菜单id'")
    private Long menuId;

    @JoinColumn(name="menu_id", insertable = false, updatable = false,foreignKey = @ForeignKey(name="none",value = ConstraintMode.NO_CONSTRAINT))
    @ManyToOne(fetch = FetchType.LAZY)
    private Menu menu;

    @Column(name="food_id",columnDefinition = "BIGINT COMMENT '场地id'")
    private Long foodId;

    @JoinColumn(name="food_id", insertable = false, updatable = false,foreignKey = @ForeignKey(name="none",value = ConstraintMode.NO_CONSTRAINT))
    @ManyToOne(fetch = FetchType.LAZY)
    private Foods foods;

}
